package gov.fema.hazus.bdc.client.login;

import gov.fema.hazus.bdc.shared.entity.User;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.ServiceDefTarget;

public class LoginServiceProxy {

    private static LoginServiceProxy instance;
    private LoginServiceAsync proxy;

    private LoginServiceProxy()
    {
        proxy = (LoginServiceAsync) GWT
                .create(LoginService.class);
        ((ServiceDefTarget) proxy).setServiceEntryPoint(GWT.getModuleBaseURL()
                + "gwt.rpc");
    }

    public static LoginServiceProxy get()
    {
        if (instance == null) {
            instance = new LoginServiceProxy();
        }
        return instance;
    }
    
	public void login(User user, AsyncCallback callback) {
		proxy.login(user, callback);
	}     
}
